package com.agileai.bpm.controller.define;

import com.agileai.bpm.bizmoduler.define.WfProcessManage;
import com.agileai.domain.DataParam;
import com.agileai.domain.DataRow;
import com.agileai.hotweb.annotation.PageAction;
import com.agileai.hotweb.controller.core.BaseHandler;
import com.agileai.hotweb.renders.AjaxRenderer;
import com.agileai.hotweb.renders.LocalRenderer;
import com.agileai.hotweb.renders.ViewRenderer;

public class WfProcessDefineXMLHandler extends BaseHandler{
	
	public ViewRenderer prepareDisplay(DataParam param){
		setAttributes(param);
		return new LocalRenderer(this.getPage());
	}
	@PageAction
	public ViewRenderer retrieveContent(DataParam param){
		WfProcessManage service = (WfProcessManage)this.lookupService(WfProcessManage.class);
		DataRow record = service.getRecord(param);
		String defineXML = record.stringValue("WFP_DEFINE");
		return new AjaxRenderer(defineXML);
	}
}
